package com.example.decorator.navigationbar;


import com.alibaba.fastjson.JSON;
import com.example.decorator.navigationbar.auth.Admin;
import com.example.decorator.navigationbar.auth.LoginUser;
import com.example.decorator.navigationbar.auth.LoginVipUser;
import com.example.decorator.navigationbar.auth.NoLoginUser;
import com.example.decorator.navigationbar.nav.*;

public class NavBarTest {
    public static void main(String[] args) {

        System.out.println("========不加权限的装饰器========");
        INav nav = new BaseNav();
        System.out.println(JSON.toJSONString(nav.getNavs()));

        HomeworkNav homeworkNav = new HomeworkNav(nav);
        System.out.println(JSON.toJSONString(homeworkNav.getNavs()));

        QuestionNav questionNav = new QuestionNav(nav);
        System.out.println(JSON.toJSONString(questionNav.getNavs()));

        GrowthWallNav growthWallNav = new GrowthWallNav(nav);
        System.out.println(JSON.toJSONString(growthWallNav.getNavs()));


        System.out.println("========加权限的装饰器========");
        System.out.println("未登录用户");
        NoLoginUser noLoginUser = new NoLoginUser();
        System.out.println(JSON.toJSONString(noLoginUser.getNavs()));

        System.out.println("已登录普通用户");
        LoginUser loginUser = new LoginUser();
        System.out.println(JSON.toJSONString(loginUser.getNavs()));

        System.out.println("已登录VIP用户");
        LoginVipUser loginVipUser = new LoginVipUser();
        System.out.println(JSON.toJSONString(loginVipUser.getNavs()));

        System.out.println("已登录管理员用户");
        Admin admin = new Admin();
        System.out.println(JSON.toJSONString(admin.getNavs()));

    }
}
